###################################################################################################
# Dyadic Representation in the American North and South: The Case of Prohibition ##################
# Michael P. Olson and James M. Snyder, Jr. #######################################################
# Run All Replication Files #######################################################################
###################################################################################################

# Working Director and Packages ###################################################################

  setwd("C:/Users/flyfi/Dropbox/Representation_on_Prohibition/olson_snyder_replication")

  if(!is.element("dplyr",installed.packages()[,1])){install.packages("dplyr")}; require(dplyr)
  if(!is.element("tidyr",installed.packages()[,1])){install.packages("tidyr")}; require(tidyr)
  if(!is.element("ggplot2",installed.packages()[,1])){install.packages("ggplot2")}; require(ggplot2)
  if(!is.element("foreign",installed.packages()[,1])){install.packages("foreign")}; require(foreign)
  if(!is.element("haven",installed.packages()[,1])){install.packages("haven")}; require(haven)
  if(!is.element("lfe",installed.packages()[,1])){install.packages("lfe")}; require(lfe)
  if(!is.element("Matching",installed.packages()[,1])){install.packages("Matching")}; require(Matching) 
  if(!is.element("multiwayvcov",installed.packages()[,1])){install.packages("multiwayvcov")}; require(multiwayvcov) 
  if(!is.element("stringr",installed.packages()[,1])){install.packages("stringr")}; require(stringr)
  if(!is.element("stargazer",installed.packages()[,1])){install.packages("stargazer")}; require(stargazer)
  if(!is.element("Hmisc",installed.packages())){install.packages("Hmisc")}; require(Hmisc)
  if(!is.element("xtable",installed.packages())){install.packages("xtable")}; require(xtable)
  if(!is.element("rowr",installed.packages())){install.packages("rowr")}; require(rowr)

# Scripts 

  source("./2.prohibition_referenda_information.R")    # checked

  source("./3.cong_rollcall_table.R")                 # checked

  source("./4.rollcall_prohibition_analysis.R")       # checked

  source("./5.state_votes_analysis.R")                # checked

  source("./6.primary_analysis.R")                   # checked




